﻿Imports System.Data.SqlClient

Public Class AdminChangePW
    Inherits System.Web.UI.Page
    Dim p As New NhanVien_DTO()
    Dim nv As New NhanVien_BLL()
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btn_xacnhan_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btn_xacnhan.Click
        Try
            p._taikhoannv = "nv2"
            p._matkhau = tb_matkhaucu.Text
            p._matkhaumoi = tb_nhaplai.Text
            nv.change_PW(p)
            successDiv.Attributes("class") = "alert alert-success"
            successDiv.Visible = True
            lb_mess.Text = "Đổi Mật Khẩu Thành Công"
        Catch ex As SqlException
            successDiv.Attributes("class") = "alert alert-warning"
            successDiv.Visible = True
            lb_mess.Text = If(String.IsNullOrEmpty(ex.Message), "Đổi Mật Khẩu Thất Bại", ex.Message)
        End Try

    End Sub
End Class